package com.river.springbootdemo.practice;

import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author chenxingyu
 * @date 2020/1/7 15:29
 */
public class FormatCheck {
    public static Pattern WEEK_NUMBER_STR_PATTERN = Pattern.compile("^[1-9]{1,2}-[1-9]{1,2}$");

    public static void main(String[] args) {
//        checkFormat();
//        splitTimes();
        String s = "";
        s = s.trim();
        System.out.println("s:" + s);
    }

    private static void splitTimes() {
        String s = "第1节";
        s = s.substring(1, s.length() - 1);
        String[] split = s.split(",");
        System.out.println(Arrays.asList(split));
    }

    private static void checkFormat() {
        Matcher matcher = WEEK_NUMBER_STR_PATTERN.matcher("11-12");
        boolean b = matcher.find();
        if (b) {
            System.out.println(matcher.groupCount());
            System.out.println(matcher.group(0));
        } else {
            System.out.println("未匹配到");
        }
    }
}
